Image encoding device, image decoding device, image encoding method, and image decoding method for generating a prediction image

ABSTRACT

When carrying out an average prediction, an intra predictor carries out a filtering process on target pixels of the intra prediction located at an upper end and a left end of the block, the filtering process using an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the target pixel. The intra predictor also sets a filter coefficient to ¾, associated with the intermediate prediction value for a target pixel at the left end of the block other than the target pixel at an upper left corner of the block, and sets a filter coefficient to ¼, associated with the adjacent pixel adjacent to the left side of the target pixel at the left end of the block. As a result, prediction errors locally occurring can be reduced, and the image quality can be improved.

This application is a Divisional of U.S. patent application Ser. No.15/192,698, filed on Jun. 24, 2016, which is a Divisional of U.S. patentapplication Ser. No. 14/977,236, filed on Dec. 21, 2015 (U.S. Pat. No.9,414,073 issued on Aug. 9, 2016), which is a Divisional of U.S. patentapplication Ser. No. 13/979,357, filed on Jul. 11, 2013 (U.S. Pat. No.9,299,133 issued on Mar. 29, 2016), which was filed as PCT InternationalApplication No. PCT/JP2012/000061 on Jan. 6, 2012, which claims thebenefit under 35 U.S.C. § 119(a) to Japanese Patent Application No.2011-004038, filed on Jan. 12, 2011, all of which are hereby expresslyincorporated by reference into the present application.

FIELD OF THE INVENTION

The present invention relates to an image encoding device for and animage encoding method of encoding an image with a high degree ofefficiency, and an image decoding device for and an image decodingmethod of decoding an encoded image with a high degree of efficiency.

BACKGROUND OF THE INVENTION

For example, in accordance with an international standard video encodingmethod, such as MPEG (Moving Picture Experts Group) or “ITU-T H.26x”, aninputted video frame is divided into rectangular blocks (encoding targetblocks), a prediction process using an already-encoded image signal iscarried out on each encoding target block to generate a predictionimage, and orthogonal transformation and a quantization process iscarried out on a prediction error signal which is the difference betweenthe encoding target block and the prediction image in units of a block,so that information compression is carried out on the inputted videoframe.

For example, in the case of MPEG-4 AVC/H.264 (ISO/IEC 14496-10|ITU-TH.264) which is an international standard method, an intra predictionprocess from already-encoded adjacent pixels or a motion-compensatedprediction process between adjacent frames is carried out (for example,refer to nonpatent reference 1). In the case of MPEG-4 AVC/H.264, oneprediction mode can be selected from a plurality of prediction modes foreach block in an intra prediction mode of luminance. FIG. 10 is anexplanatory drawing showing intra prediction modes in the case of a 4×4pixel block size for luminance. In FIG. 10, each white circle shows apixel in a coding block, and each black circle shows a pixel that isused for prediction, and that exists in an already-encoded adjacentblock.

In the example shown in FIG. 10, nine modes 0 to 8 are prepared as intraprediction modes, and the mode 2 is the one in which an averageprediction is carried out in such a way that each pixel in the targetcoding block is predicted by using the average of adjacent pixelsexisting in the upper and left blocks. The modes other than the mode 2are intra prediction modes in each of which a directional prediction iscarried out. The mode 0 is the one in which a vertical prediction iscarried out in such a way that adjacent pixels in the upper block arerepeatedly replicated to create plural rows of pixels along a verticaldirection to generate a prediction image. For example, the mode 0 isselected when the target coding block is a vertically striped pattern.The mode 1 is the one in which a horizontal prediction is carried out insuch a way that adjacent pixels in the left block are repeatedlyreplicated to create plural columns of pixels along a horizontaldirection to generate a prediction image. For example, the mode 1 isselected when the target coding block is a horizontally striped pattern.In each of the modes 3 to 8, interpolation pixels running in apredetermined direction (i.e., a direction shown by arrows) aregenerated by using the adjacent pixels in the upper block or the leftblock to generate a prediction image.

In this case, the block size for luminance to which an intra predictionis applied can be selected from 4×4 pixels, 8×8 pixels, and 16×16pixels. In the case of 8×8 pixels, nine intra prediction modes aredefined, like in the case of 4×4 pixels. In contrast with this, in thecase of 16×16 pixels, four intra prediction modes which are called planepredictions are defined in addition to intra prediction modes associatedwith an average prediction, a vertical prediction, and a horizontalprediction. Each intra prediction associated with a plane prediction isa mode in which pixels created by carrying out an interpolation in adiagonal direction on the adjacent pixels in the upper block and theadjacent pixels in the left block are provided as predicted values.

In an intra prediction mode in which a directional prediction is carriedout, because predicted values are generated along a directionpredetermined by the mode, e.g., a direction of 45 degrees, theprediction efficiency increases and the code amount can be reduced whenthe direction of a boundary (edge) of an object in a block matches thedirection shown by the prediction mode. However, a slight displacementmay occur between the direction of an edge and the direction shown bythe prediction mode, and, even if the direction of an edge in theencoding target block does not match the direction shown by theprediction mode, a large prediction error may occur locally for thesimple reason that the edge is slightly distorted (swung, bent, or thelike). As a result, the prediction efficiency may drop extremely. Inorder to prevent such a reduction in the prediction efficiency, whenperforming an 8×8-pixel directional prediction, a prediction process iscarried out to generate a smoothed prediction image by usingalready-encoded adjacent pixels on which a smoothing process has beencarried out, thereby reducing any slight displacement in the predictiondirection and prediction errors which occur when a slight distortionoccurs in an edge.

RELATED ART DOCUMENT Nonpatent Reference

-   Nonpatent reference 1: MPEG-4 AVC (ISO/IEC 14496-10)/ITU-T H.264    standards

SUMMARY OF THE INVENTION Problems to be Solved by the Invention

Because the conventional image encoding device is constructed as above,the generation of a smoothed prediction image can reduce predictionerrors occurring even if a slight displacement occurs in the predictiondirection or a slight distortion occurs in an edge. However, accordingto the technique disclosed in nonpatent reference 1, no smoothingprocess is carried out on blocks other than 8×8-pixel blocks, and onlyone possible smoothing process is carried out on even 8×8-pixel blocks.A problem is that also in a block having a size other than 8×8 pixels, alarge prediction error actually occurs locally due to a slight mismatchin an edge even when the prediction image has a pattern similar to thatof the image to be encoded, and therefore a large reduction occurs inthe prediction efficiency. Another problem is that when a quantizationparameter which is used when quantizing a prediction error signal, theposition of each pixel in a block, the prediction mode, or the likediffers between blocks having the same size, a process suitable forreducing local prediction errors differs between the blocks, but onlyone possible smoothing process is prepared, and therefore predictionerrors cannot be sufficiently reduced. A further problem is that whencarrying out an average prediction, a prediction signal for a pixellocated at a boundary of a block easily becomes discontinuous with thosefor adjacent encoded pixels because the average of pixels adjacent tothe block is defined as each of all the predicted values in the block,while because the image signal generally has a high spatial correlation,a prediction error easily occurs at the block boundary due to theabove-mentioned discontinuity.

The present invention is made in order to solve the above-mentionedproblems, and it is therefore an object of the present invention toprovide an image encoding device, an image decoding device, an imageencoding method, and an image decoding method capable of reducingprediction errors which occur locally, thereby being able to improve theimage quality.

Means for Solving the Problem

In accordance with an aspect of the present invention, there is providedan image encoding device that includes an intra predictor for, when acoding mode corresponding to one of coding blocks into which an inputtedimage is divided is an intra coding mode, carrying out an intra-frameprediction process on each block which is a unit for prediction of thecoding block to generate a prediction image; and an encoder for encodingcoding mode information and an intra prediction parameter indicating anaverage prediction, wherein when the intra predictor carries out theaverage prediction, the intra predictor carries out a filtering processon target pixels of the intra prediction located at an upper end and aleft end of the block, the filtering process using an intermediateprediction value, which is an average value of adjacent pixels of theblock, and at least one adjacent pixel of the target pixel, and whereinthe intra predictor sets a filter coefficient to ¾, associated with theintermediate prediction value for a target pixel at the left end of theblock other than the target pixel at an upper left corner of the block,and sets a filter coefficient to ¼, associated with the adjacent pixeladjacent to the left side of the target pixel at the left end of theblock.

In accordance with another aspect of the present invention, there isprovided an image decoding device that includes: a decoder for decodingcoding mode information and an intra prediction parameter; and an intrapredictor for, when the coding mode information associated with a codingblock is an intra coding mode, carrying out an intra-frame predictionprocess on each block which is a unit for prediction of the coding blockto generate a prediction image, wherein when the intra predictionparameter indicates an average prediction, the intra predictor carriesout a filtering process on target pixels of the intra prediction locatedat an upper end and a left end of the block based on an intermediateprediction value, which is an average value of adjacent pixels of theblock, and at least one adjacent pixel of the target pixel, and whereinthe intra predictor sets a filter coefficient to ¾, associated with theintermediate prediction value for a target pixel at the left end of theblock other than the target pixel at an upper left corner of the block,and sets a filter coefficient to ¼, associated with the adjacent pixeladjacent to the left side of the target pixel at the left end of theblock.

In accordance with yet another aspect of the present invention, there isprovided an image encoding method including: carrying out an intra-frameprediction process on each block which is a unit for prediction of acoding block to generate a prediction image, when a coding modecorresponding to the coding block into which an inputted image isdivided is an intra coding mode; and encoding coding mode informationand an intra prediction parameter indicating an average prediction,wherein when the average prediction is carried out, a filtering processis carried out on target pixels of the intra prediction located at anupper end and a left end of the block which is a unit for prediction ofthe coding block, the filtering process using an intermediate predictionvalue, which is an average value of adjacent pixels of the block, and atleast one adjacent pixel of the target pixel, and wherein the filteringprocess sets a filter coefficient to ¾, associated with the intermediateprediction value for a target pixel at the left end of the block otherthan the target pixel at an upper left corner of the block, and sets afilter coefficient to ¼, associated with the adjacent pixel adjacent tothe left side of the target pixel at the left end of the block.

In accordance with another aspect of the present invention, there isprovided an image decoding method including: decoding coding modeinformation and an intra prediction parameter; and carrying out anintra-frame prediction process on each block which is a unit forprediction of a coding block to generate a prediction image, when thecoding mode information associated with the coding block is an intracoding mode, wherein when the intra prediction parameter indicates anaverage prediction, a filtering process is carried out on target pixelsof the intra prediction located at an upper end and a left end of theblock which is a unit for prediction of the coding block, the filteringprocess using an intermediate prediction value, which is an averagevalue of adjacent pixels of the block, and at least one adjacent pixelof the target pixel, and wherein the filtering process sets a filtercoefficient to ¾, associated with the intermediate prediction value fora target pixel at the left end of the block other than the target pixelat an upper left corner of the block, and sets a filter coefficient to¼, associated with the adjacent pixel adjacent to the left side of thetarget pixel at the left end of the block.

In accordance with another aspect of the present invention, there isprovided a non-transitory computer readable medium comprising coded datafor each of coding blocks, the coded data including: coding modeinformation causing a decoder to determine a type of coding mode, andcausing the decoder to carry out an intra-frame prediction process oneach block which is a unit for prediction of a coding block to generatea prediction image, when the coding mode information associated with thecoding block indicates an intra coding mode; and an intra predictionparameter causing the decoder to determine a type of intra prediction,wherein when the intra prediction parameter indicates an averageprediction, a filtering process is carried out on target pixels of theintra prediction located at an upper end and a left end of the blockwhich is a unit for prediction of the coding block, the filteringprocess using an intermediate prediction value, which is an averagevalue of adjacent pixels of the block, and at least one adjacent pixelof the target pixel, and wherein the filtering process sets a filtercoefficient to ¾, associated with the intermediate prediction value fora target pixel at the left end of the block other than the target pixelat an upper left corner of the block, and sets a filter coefficient to¼, associated with the adjacent pixel adjacent to the left side of thetarget pixel at the left end of the block.

Advantages of the Invention

Because the image encoding device in accordance with the presentinvention is constructed in such a way that when carrying out an averageprediction, an intra predictor carries out a filtering process on targetpixels of the intra prediction located at an upper end and a left end ofthe block, the filtering process using an intermediate prediction value,which is an average value of adjacent pixels of the block, and at leastone adjacent pixel of the target pixel, and the intra predictor sets afilter coefficient to ¾, associated with the intermediate predictionvalue for a target pixel at the left end of the block other than thetarget pixel at an upper left corner of the block, and sets a filtercoefficient to ¼, associated with the adjacent pixel adjacent to theleft side of the target pixel at the left end of the block, there isprovided an advantage of being able to reduce prediction errorsoccurring locally, thereby being able to improve the image quality.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 is a block diagram showing a moving image encoding device inaccordance with Embodiment 1 of the present invention;

FIG. 2 is a block diagram showing a moving image decoding device inaccordance with Embodiment 1 of the present invention;

FIG. 3 is a flow chart showing processing carried out by the movingimage encoding device in accordance with Embodiment 1 of the presentinvention;

FIG. 4 is a flow chart showing processing carried out by the movingimage decoding device in accordance with Embodiment 1 of the presentinvention;

FIG. 5 is an explanatory drawing showing a state in which each codingblock having a maximum size is hierarchically divided into a pluralityof coding blocks;

FIG. 6(A) is an explanatory drawing showing a distribution of partitionsinto which a block to encoded is divided, and FIG. 6(B) is anexplanatory drawing showing a state in which a coding mode m(B^(n)) isassigned to each of the partitions after a hierarchical layer divisionis performed by using a quadtree graph;

FIG. 7 is an explanatory drawing showing an example of intra predictionparameters (intra prediction modes) which can be selected for eachpartition P_(i) ^(n) in a coding block B^(n).

FIG. 8 is an explanatory drawing showing an example of pixels which areused when generating a predicted value of each pixel in a partitionP_(i) ^(n) in the case of l_(i) ^(n)=m_(i) ^(n)=4;

FIG. 9 is an explanatory drawing showing an example of the arrangementof reference pixels in the case of N=5;

FIG. 10 is an explanatory drawing showing intra prediction modesdescribed in nonpatent reference 1 in the case of a 4×4 pixel block sizefor luminance;

FIG. 11 is an explanatory drawing showing an example of the distancesbetween already-encoded pixels in a frame which are used when generatinga prediction image, and each target pixel to be filtered;

FIG. 12 is an explanatory drawing showing a concrete arrangement ofreference pixels to be referred to by a filter;

FIG. 13 is an explanatory drawing showing an example of a table fordetermining which filter is to be used for each combination of an intraprediction mode index and a partition size;

FIG. 14 is an explanatory drawing showing an example of simplificationof a filtering process when an average prediction is carried out;

FIG. 15 is an explanatory drawing showing an example of a bitstream inwhich a filter selection table index is added to a sequence levelheader;

FIG. 16 is an explanatory drawing showing an example of a bitstream inwhich a filter selection table index is added to a picture level header;

FIG. 17 is an explanatory drawing showing an example of a bitstream inwhich a filter selection table index is added to a slice header;

FIG. 18 is an explanatory drawing showing an example of a bitstream inwhich a filter selection table index is added to a reference blockheader;

FIG. 19 is an explanatory drawing showing another example of the table,which differs from that shown in FIG. 13, for determining which filteris to be used for each combination of an intra prediction mode index anda partition size; and

FIG. 20 is an explanatory drawing showing an example of a table fordetermining whether or not to carry out a smoothing process on referencepixels at the time of generating an intermediate prediction image foreach combination of an intra prediction mode index and a partition size.

EMBODIMENTS OF THE INVENTION

Hereafter, in order to explain this invention in greater detail, thepreferred embodiments of the present invention will be described withreference to the accompanying drawings.

Embodiment 1

In this Embodiment 1, a moving image encoding device that inputs eachframe image of a video, carries out an intra prediction process fromalready-encoded adjacent pixels or a motion-compensated predictionprocess between adjacent frames to generate a prediction image, carriesout a compression process according to orthogonal transformation andquantization on a prediction error signal which is a difference imagebetween the prediction image and a frame image, and, after that, carriesout variable length encoding to generate a bitstream, and a moving imagedecoding device that decodes the bitstream outputted from the movingimage encoding device will be explained.

The moving image encoding device in accordance with this Embodiment 1 ischaracterized in that the moving image encoding device adapts itself toa local change of a video signal in space and time directions to dividethe video signal into regions of various sizes, and carries outintra-frame and inter-frame adaptive encoding. In general, a videosignal has a characteristic of its complexity varying locally in spaceand time. There can be a case in which a pattern having a uniform signalcharacteristic in a relatively large image region, such as a sky imageor a wall image, or a pattern having a complicated texture pattern in asmall image region, such as a person image or a picture including a finetexture, also coexists on a certain video frame from the viewpoint ofspace. Also from the viewpoint of time, a relatively large image area,such as a sky image or a wall image, has a small local change in a timedirection in its pattern, while an image of a moving person or objecthas a larger temporal change because its outline has a movement of arigid body and a movement of a non-rigid body with respect to time.

Although a process of generating a prediction error signal having smallsignal power and small entropy by using temporal and spatial prediction,thereby reducing the whole code amount, is carried out in the encodingprocess, the code amount of parameters used for the prediction can bereduced as long as the parameters can be applied uniformly to as largean image signal region as possible. On the other hand, because theamount of errors occurring in the prediction increases when the sameprediction parameters are applied to an image signal pattern having alarge change in time and space, the code amount of the prediction errorsignal cannot be reduced. Therefore, it is desirable to reduce the sizeof a region which is subjected to the prediction process when performingthe prediction process on an image signal pattern having a large changein time and space, thereby reducing the electric power and entropy ofthe prediction error signal even though the data volume of theparameters which are used for the prediction is increased. In order tocarry out encoding which is adapted for such the typical characteristicsof a video signal, the moving image encoding device in accordance withthis Embodiment 1 hierarchically divides each region having apredetermined maximum block size of the video signal into blocks, andcarries out the prediction process and the encoding process of encodinga prediction error on each of the blocks into which each region isdivided.

A video signal which is to be processed by the moving image encodingdevice in accordance with this Embodiment 1 can be an arbitrary videosignal in which each video frame consists of a series of digital samples(pixels) in two dimensions, horizontal and vertical, such as a YUVsignal which consists of a luminance signal and two color differencesignals, a color video image signal in arbitrary color space, such as anRGB signal, outputted from a digital image sensor, a monochrome imagesignal, or an infrared image signal. The gradation of each pixel can bean 8-bit, 10-bit, or 12-bit one. In the following explanation, theinputted video signal is a YUV signal unless otherwise specified. It isfurther assumed that the two color difference components U and V aresignals having a 4:2:0 format which are subsampled with respect to theluminance component Y. A data unit to be processed which corresponds toeach frame of the video signal is referred to as a “picture.” In thisEmbodiment 1, a “picture” is explained as a video frame signal on whichprogressive scanning has been carried out. When the video signal is aninterlaced signal, a “picture” can be alternatively a field image signalwhich is a unit which constructs a video frame.

FIG. 1 is a block diagram showing a moving image encoding device inaccordance with Embodiment 1 of the present invention. Referring to FIG.1, an encoding controlling part 1 carries out a process of determining amaximum size of each of coding blocks which is a unit to be processed ata time when an intra prediction process (intra-frame prediction process)or a motion-compensated prediction process (inter-frame predictionprocess) is carried out, and also determining an upper limit on thenumber of hierarchical layers, i.e., a maximum hierarchy depth in ahierarchy in which each of the coding blocks having the maximum size ishierarchically divided into blocks. The encoding controlling part 1 alsocarries out a process of selecting a coding mode suitable for each ofthe coding blocks into which each coding block having the maximum sizeis divided hierarchically from one or more available coding modes (oneor more intra coding modes and one or more inter coding modes). Theencoding controlling part 1 further carries out a process of determininga quantization parameter and a transform block size which are used whena difference image is compressed for each coding block, and alsodetermining intra prediction parameters or inter prediction parameterswhich are used when a prediction process is carried out for each codingblock. The quantization parameter and the transform block size areincluded in prediction error encoding parameters, and these predictionerror encoding parameters are outputted to a transformation/quantizationpart 7, an inverse quantization/inverse transformation part 8, avariable length encoding part 13, and so on. The encoding controllingpart 1 constructs an encoding controlling unit.

A block dividing part 2 carries out a process of, when receiving a videosignal showing an inputted image, dividing the inputted image shown bythe video signal into coding blocks each having the maximum sizedetermined by the encoding controlling part 1, and also dividing each ofthe coding blocks into blocks hierarchically until the number ofhierarchical layers reaches the upper limit on the number ofhierarchical layers which is determined by the encoding controlling part1. The block dividing part 2 constructs a block dividing unit. Aselection switch 3 carries out a process of, when the coding modeselected by the encoding controlling part 1 for the coding block, whichis generated through the division by the block dividing part 2, is anintra coding mode, outputting the coding block to an intra predictionpart 4, and, when the coding mode selected by the encoding controllingpart 1 for the coding block, which is generated through the division bythe block dividing part 2, is an inter coding mode, outputting thecoding block to a motion-compensated prediction part 5.

The intra prediction part 4 carries out a process of, when receiving thecoding block, which is generated through the division by the blockdividing part 2, from the selection switch 3, carrying out an intraprediction process on the coding block to generate a prediction imagefor each partition by using an already-encoded image signal in the frameon the basis of the intra prediction parameter outputted thereto fromthe encoding controlling part 1. After generating the above-mentionedprediction image, the intra prediction part 4 selects a filter from oneor more filters which are prepared in advance according to the states ofthe various parameters which must be known when the moving imagedecoding device generates the same prediction image as theabove-mentioned prediction image, carries out a filtering process on theabove-mentioned prediction image by using the filter, and outputs theprediction image on which the intra prediction part has carried out thefiltering process to a subtracting part 6 and an adding part 9.Concretely, the intra prediction part uniquely determines a filteraccording to the state of at least one of the following four parameterswhich are provided as the above-mentioned various parameters:

Parameter (1)

The block size of the above-mentioned prediction image

Parameter (2)

The quantization parameter determined by the encoding controlling part 1

Parameter (3)

The distance between the already-encoded image signal in the frame whichis used when generating the prediction image and a target pixel to befiltered

Parameter (4)

The intra prediction parameter determined by the encoding controllingpart 1An intra prediction unit is comprised of the selection switch 3 and theintra prediction part 4.

The motion-compensated prediction part 5 carries out a process of, whenan inter coding mode is selected by the encoding controlling part 1 as acoding mode suitable for the coding block, which is generated throughthe division by the block dividing part 2, performing amotion-compensated prediction process on the coding block to generate aprediction image by using one or more frames of reference images storedin a motion-compensated prediction frame memory 12 on the basis of theinter prediction parameters outputted thereto from the encodingcontrolling part 1. A motion-compensated prediction unit is comprised ofthe selection switch 3 and the motion-compensated prediction part 5.

The subtracting part 6 carries out a process of subtracting theprediction image generated by the intra prediction part 4 or themotion-compensated prediction part 5 from the coding block, which isgenerated through the division by the block dividing part 2, to generatea difference image (=the coding block—the prediction image). Thesubtracting part 6 constructs a difference image generating unit. Thetransformation/quantization part 7 carries out a process of performing atransformation process (e.g., a DCT (discrete cosine transform) or anorthogonal transformation process, such as a KL transform, in whichbases are designed for a specific learning sequence in advance) on thedifference signal generated by the subtracting part 6 in units of ablock having a transform block size included in the prediction errorencoding parameters outputted thereto from the encoding controlling part1, and also quantizing the transform coefficients of the differenceimage by using a quantization parameter included in the prediction errorencoding parameters to output the transform coefficients quantizedthereby as compressed data of the difference image. Thetransformation/quantization part 7 constructs an image compression unit.

The inverse quantization/inverse transformation part 8 carries out aprocess of inverse-quantizing the compressed data outputted thereto fromthe transformation/quantization part 7 by using the quantizationparameter included in the prediction error encoding parameters outputtedthereto from the encoding controlling part 1, and performing an inversetransformation process (e.g., an inverse DCT (inverse discrete cosinetransform) or an inverse transformation process such as an inverse KLtransform) on the compressed data inverse-quantized thereby in units ofa block having the transform block size included in the prediction errorencoding parameters to output the compressed data on which the inversequantization/inverse transformation part has carried out the inversetransformation process as a local decoded prediction error signal.

The adding part 9 carries out a process of adding the local decodedprediction error signal outputted thereto from the inversequantization/inverse transformation part 8 and the prediction signalshowing the prediction image generated by the intra prediction part 4 orthe motion-compensated prediction part 5 to generate a local decodedimage signal showing a local decoded image. A memory 10 for intraprediction is a recording medium, such as a RAM, for storing the localdecoded image shown by the local decoded image signal generated by theadding part 9 as an image which the intra prediction part 4 will usewhen performing the intra prediction process the next time.

A loop filter part 11 carries out a process of compensating for anencoding distortion included in the local decoded image signal generatedby the adding part 9, and outputting the local decoded image shown bythe local decoded image signal on which the loop filter part has carriedout the encoding distortion compensation to a motion-compensatedprediction frame memory 12 as a reference image. The motion-compensatedprediction frame memory 12 is a recording medium, such as a RAM, forstoring the local decoded image on which the loop filter part 11 hascarried out the filtering process as a reference image which themotion-compensated prediction part 5 will use when performing themotion-compensated prediction process the next time.

The variable length encoding part 13 carries out a process ofvariable-length-encoding the compressed data outputted thereto from thetransformation/quantization part 7, the coding mode and the predictionerror encoding parameters which are outputted thereto from the encodingcontrolling part 1, and the intra prediction parameters outputtedthereto from the intra prediction part 4 or the inter predictionparameters outputted thereto from the motion-compensated prediction part5 to generate a bitstream into which encoded data of the compresseddata, encoded data of the coding mode, encoded data of the predictionerror encoding parameters, and encoded data of the intra predictionparameters or the inter prediction parameters are multiplexed. Thevariable length encoding part 13 constructs a variable length encodingunit.

FIG. 2 is a block diagram showing the moving image decoding device inaccordance with Embodiment 1 of the present invention. Referring to FIG.2, a variable length decoding part 51 carries out a process ofvariable-length-decoding the encoded data multiplexed into the bitstreamto acquire the compressed data, the coding mode, the prediction errorencoding parameters, and the intra prediction parameters or the interprediction parameters, which are associated with each coding block intowhich each frame of the video is hierarchically divided, and outputtingthe compressed data and the prediction error encoding parameters to aninverse quantization/inverse transformation part 55, and also outputtingthe coding mode and the intra prediction parameters or the interprediction parameters to a selection switch 52. The variable lengthdecoding part 51 constructs a variable length decoding unit.

The selection switch 52 carries out a process of, when the coding modeassociated with the coding block, which is outputted from the variablelength decoding part 51, is an intra coding mode, outputting the intraprediction parameters outputted thereto from the variable lengthdecoding part 51 to an intra prediction part 53, and, when the codingmode is an inter coding mode, outputting the inter prediction parametersoutputted thereto from the variable length decoding part 51 to amotion-compensated prediction part 54.

The intra prediction part 53 carries out a process of performing anintra-frame prediction process on the coding block to generate aprediction image for each partition by using an already-decoded imagesignal in the frame on the basis of the intra prediction parameteroutputted thereto from the selection switch 52. After generating theabove-mentioned prediction image, the intra prediction part 53 selects afilter from one or more filters which are prepared in advance accordingto the states of the various parameters which are known when generatingthe above-mentioned prediction image, carries out a filtering process onthe above-mentioned prediction image by using the filter, and outputsthe prediction image on which the intra prediction part has carried outthe filtering process to an adding part 56. Concretely, the intraprediction part uniquely determines a filter according to the state ofat least one of the following four parameters which are provided as theabove-mentioned various parameters. The intra prediction partpredetermines one or more parameters to be used which are the same asthe previously-mentioned one or more parameters which are used by themoving image encoding device. More specifically, the parameters whichthe moving image encoding device uses and those which the moving imagedecoding device uses are made to be the same as each other in such a waythat when the intra prediction part 4 carries out the filtering processby using the parameters (1) and (4) in the moving image encoding device,the intra prediction part 53 similarly carries out the filtering byusing the parameters (1) and (4) in the moving image decoding device,for example.

Parameter (1)

The block size of the above-mentioned prediction image

Parameter (2)

The quantization parameter variable-length-decoded by the variablelength decoding part 51

Parameter (3)

The distance between the already-decoded image signal in the frame whichis used when generating the prediction image and a target pixel to befiltered

Parameter (4)

The intra prediction parameter variable-length-decoded by the variablelength decoding part 51An intra prediction unit is comprised of the selection switch 52 and theintra prediction part 53.

The motion-compensated prediction part 54 carries out a process ofperforming a motion-compensated prediction process on the coding blockto generate a prediction image by using one or more frames of referenceimages stored in a motion-compensated prediction frame memory 59 on thebasis of the inter prediction parameters outputted thereto from theselection switch 52. A motion-compensated prediction unit is comprisedof the selection switch 52 and the motion-compensated prediction part54.

The inverse quantization/inverse transformation part 55 carries out aprocess of inverse-quantizing the compressed data associated with thecoding block, which is outputted thereto from the variable lengthdecoding part 51, by using the quantization parameter included in theprediction error encoding parameters outputted thereto from the variablelength decoding part 51, and performing an inverse transformationprocess (e.g., an inverse DCT (inverse discrete cosine transform) or aninverse transformation process such as an inverse KL transform) on thecompressed data inverse-quantized thereby in units of a block having thetransform block size included in the prediction error encodingparameters, and outputting the compressed data on which the inversequantization/inverse transformation part has carried out the inversetransformation process as a decoded prediction error signal (signalshowing a pre-compressed difference image). The inversequantization/inverse transformation part 55 constructs a differenceimage generating unit.

The adding part 56 carries out a process of adding the decodedprediction error signal outputted thereto from the inversequantization/inverse transformation part 55 and the prediction signalshowing the prediction image generated by the intra prediction part 53or the motion-compensated prediction part 54 to generate a decoded imagesignal showing a decoded image. The adding part 56 constructs a decodedimage generating unit. A memory 57 for intra prediction is a recordingmedium, such as a RAM, for storing the decoded image shown by thedecoded image signal generated by the adding part 56 as an image whichthe intra prediction part 53 will use when performing the intraprediction process the next time.

A loop filter part 58 carries out a process of compensating for anencoding distortion included in the decoded image signal generated bythe adding part 56, and outputting the decoded image shown by thedecoded image signal on which the loop filter part performs the encodingdistortion compensation to a motion-compensated prediction frame memory59 as a reference image. The motion-compensated prediction frame memory59 is a recording medium, such as a RAM, for storing the decoded imageon which the loop filter part 58 performs the filtering process as areference image which the motion-compensated prediction part 54 will usewhen performing the motion-compensated prediction process the next time.

In the example shown in FIG. 1, the encoding controlling part 1, theblock dividing part 2, the selection switch 3, the intra prediction part4, the motion-compensated prediction part 5, the subtracting part 6, thetransformation/quantization part 7, the inverse quantization/inversetransformation part 8, the adding part 9, the loop filter part 11, andthe variable length encoding part 13, which are the components of themoving image encoding device, can consist of pieces of hardware forexclusive use (e.g., integrated circuits in each of which a CPU ismounted, one chip microcomputers, or the like), respectively. As analternative, the moving image encoding device can consist of a computer,and a program in which the processes carried out by the encodingcontrolling part 1, the block dividing part 2, the selection switch 3,the intra prediction part 4, the motion-compensated prediction part 5,the subtracting part 6, the transformation/quantization part 7, theinverse quantization/inverse transformation part 8, the adding part 9,the loop filter part 11, and the variable length encoding part 13 aredescribed can be stored in a memory of the computer and the CPU of thecomputer can be made to execute the program stored in the memory. FIG. 3is a flow chart showing the processing carried out by the moving imageencoding device in accordance with Embodiment 1 of the presentinvention.

In the example shown in FIG. 2, the variable length decoding part 51,the selection switch 52, the intra prediction part 53, themotion-compensated prediction part 54, the inverse quantization/inversetransformation part 55, the adding part 56, and the loop filter part 58,which are the components of the moving image decoding device, canconsist of pieces of hardware for exclusive use (e.g., integratedcircuits in each of which a CPU is mounted, one chip microcomputers, orthe like), respectively. As an alternative, the moving image decodingdevice can consist of a computer, and a program in which the processescarried out by the variable length decoding part 51, the selectionswitch 52, the intra prediction part 53, the motion-compensatedprediction part 54, the inverse quantization/inverse transformation part55, the adding part 56, and the loop filter part 58 are described can bestored in a memory of the computer and the CPU of the computer can bemade to execute the program stored in the memory. FIG. 4 is a flow chartshowing the processing carried out by the moving image decoding devicein accordance with Embodiment 1 of the present invention.

Next, the operation of the moving image encoding device and that of themoving image decoding device will be explained. First, the processingcarried out by the moving image encoding device shown in FIG. 1 will beexplained. First, the encoding controlling part 1 determines a maximumsize of each of coding blocks which is a unit to be processed at a timewhen an intra prediction process (intra-frame prediction process) or amotion-compensated prediction process (inter-frame prediction process)is carried out, and also determines an upper limit on the number ofhierarchical layers in a hierarchy in which each of the coding blockshaving the maximum size is hierarchically divided into blocks (step ST1of FIG. 3).

As a method of determining the maximum size of each of coding blocks,for example, there is considered a method of determining a maximum sizefor all the pictures according to the resolution of the inputted image.Further, there can be considered a method of quantifying a variation inthe complexity of a local movement of the inputted image as a parameterand then determining a small size for a picture having a large andvigorous movement while determining a large size for a picture having asmall movement. As a method of determining the upper limit on the numberof hierarchical layers, for example, there can be considered a method ofincreasing the depth of the hierarchy, i.e., the number of hierarchicallayers to make it possible to detect a finer movement as the inputtedimage has a larger and more vigorous movement, or decreasing the depthof the hierarchy, i.e., the number of hierarchical layers as theinputted image has a smaller movement.

The encoding controlling part 1 also selects a coding mode suitable foreach of the coding blocks into which each coding block having themaximum size is divided hierarchically from one or more available codingmodes (M intra coding modes and N inter coding modes) (step ST2).Although a detailed explanation of the selection method of selecting acoding mode for use in the encoding controlling part 1 will be omittedbecause the selection method is a known technique, there is a method ofcarrying out an encoding process on the coding block by using anarbitrary available coding mode to examine the encoding efficiency andselect a coding mode having the highest level of encoding efficiencyfrom among a plurality of available coding modes, for example.

The encoding controlling part 1 further determines a quantizationparameter and a transform block size which are used when a differenceimage is compressed for each coding block, and also determines intraprediction parameters or inter prediction parameters which are used whena prediction process is carried out. The encoding controlling part 1outputs prediction error encoding parameters including the quantizationparameter and the transform block size to thetransformation/quantization part 7, the inverse quantization/inversetransformation part 8, and the variable length encoding part 13. Theencoding controlling part also outputs the prediction error encodingparameters to the intra prediction part 4 as needed.

When receiving the video signal showing the inputted image, the blockdividing part 2 divides the inputted image shown by the video signalinto coding blocks each having the maximum size determined by theencoding controlling part 1, and also divides each of the coding blocksinto blocks hierarchically until the number of hierarchical layersreaches the upper limit on the number of hierarchical layers which isdetermined by the encoding controlling part 1. FIG. 5 is an explanatorydrawing showing a state in which each coding block having the maximumsize is hierarchically divided into a plurality of coding blocks. In theexample of FIG. 5, each coding block having the maximum size is a codingblock B⁰ in the 0th hierarchical layer, and its luminance component hasa size of (L⁰, M⁰). Further, in the example of FIG. 5, by carrying outthe hierarchical division with this coding block B⁰ having the maximumsize being set as a starting point until the depth of the hierarchyreaches a predetermined depth which is set separately according to aquadtree structure, coding blocks B^(n) can be acquired.

At the depth of n, each coding block B^(n) is an image region having asize of (L^(n), M^(n)). Although L^(n) can be the same as or differ fromM^(n), the case of L^(n)=M^(n) is shown in the example of FIG. 5.Hereafter, the size of each coding block B^(n) is defined as the size of(L^(n), M^(n)) in the luminance component of the coding block B^(n).

Because the block dividing part 2 carries out a quadtree division,(L^(n+1), M^(n+1))=(L^(n)/2, M^(n)/2) is always established. In the caseof a color video image signal (4:4:4 format) in which all the colorcomponents have the same sample number, such as an RGB signal, all thecolor components have a size of (L^(n), M^(n)), while in the case ofhandling a 4:2:0 format, a corresponding color difference component hasa coding block size of (L^(n)/2, M^(n)/2). Hereafter, a coding modeselectable for each coding block B^(n) in the nth hierarchical layer isexpressed as m(B^(n)).

In the case of a color video signal which consists of a plurality ofcolor components, the coding mode m(B^(n)) can be formed in such a waythat an individual mode is used for each color component. Hereafter, anexplanation will be made by assuming that the coding mode m(B^(n))indicates the one for the luminance component of each coding blockhaving a 4:2:0 format in a YUV signal unless otherwise specified. Thecoding mode m(B^(n)) can be one of one or more intra coding modes(generically referred to as “INTRA”) or one or more inter coding modes(generically referred to as “INTER”), and the encoding controlling part1 selects, as the coding mode m(B^(n)), a coding mode with the highestdegree of encoding efficiency for each coding block B^(n) from among allthe coding modes available in the picture currently being processed or asubset of these coding modes, as mentioned above.

Each coding block B^(n) is further divided into one or more predictionunits (partitions) by the block dividing part, as shown in FIG. 5.Hereafter, each partition belonging to each coding block B^(n) isexpressed as P_(i) ^(n) (i shows a partition number in the nthhierarchical layer). How the division of each coding block B^(n) intopartitions P_(i) ^(n) belonging to the coding block B^(n) is carried outis included as information in the coding mode m(B^(n)). While theprediction process is carried out on each of all the partitions P_(i)^(n) according to the coding mode m(B^(n)), an individual predictionparameter can be selected for each partition P_(i) ^(n).

The encoding controlling part 1 produces such a block division state asshown in, for example, FIG. 6 for a coding block having the maximumsize, and then determines coding blocks B^(n). Hatched portions shown inFIG. 6(a) show a distribution of partitions into which the coding blockhaving the maximum size is divided, and FIG. 6(b) shows a situation inwhich coding modes m(B^(n)) are respectively assigned to the partitionsgenerated through the hierarchical layer division by using a quadtreegraph. Each node enclosed by a square symbol shown in FIG. 6(b) is theone (coding block B^(n)) to which a coding mode m(B^(n)) is assigned.

When the encoding controlling part 1 selects an optimal coding modem(B^(n)) for each partition P_(i) ^(n) of each coding block B^(n), andthe coding mode m(B^(n)) is an intra coding mode (step ST3), theselection switch 3 outputs the partition P_(i) ^(n) of the coding blockB^(n), which is generated through the division by the block dividingpart 2, to the intra prediction part 4. In contrast, when the codingmode m(B^(n)) is an inter coding mode (step ST3), the selection switchoutputs the partition P_(i) ^(n) of the coding block B^(n), which isgenerated through the division by the block dividing part 2, to themotion-compensated prediction part 5.

When receiving the partition P_(i) ^(n) of the coding block B^(n) fromthe selection switch 3, the intra prediction part 4 carries out an intraprediction process on the partition P_(i) ^(n) of the coding block B^(n)to generate an intra prediction image P_(i) ^(n) by using analready-encoded image signal in the frame on the basis of the intraprediction parameter outputted thereto from the encoding controllingpart 1 (step ST4). After generating the above-mentioned intra predictionimage P_(i) ^(n), the intra prediction part 4 selects a filter from theone or more filters which are prepared in advance according to thestates of the various parameters which must be known when the movingimage decoding device generates the same prediction image as theabove-mentioned intra prediction image P_(i) ^(n), and carries out afiltering process on the intra prediction image P_(i) ^(n) by using thefilter. After carrying out the filtering process on the intra predictionimage P_(i) ^(n), the intra prediction part 4 outputs the intraprediction image P_(i) ^(n) on which the intra prediction part hascarried out the filtering process to the subtracting part 6 and theadding part 9. In order to enable the moving image decoding device shownin FIG. 2 to also be able to generate the same intra prediction imageP_(i) ^(n), the intra prediction part outputs the intra predictionparameters to the variable length encoding part 13. The outline of theprocess carried out by the intra prediction part 4 is as mentionedabove, and the details of this process will be mentioned below.

When receiving the partition P_(i) ^(n) of the coding block B^(n) fromthe selection switch 3, the motion-compensated prediction part 5 carriesout a motion-compensated prediction process on the partition P_(i) ^(n)of the coding block B^(n) to generate an inter prediction image P_(i)^(n) by using one or more frames of reference images stored in themotion-compensated prediction frame memory 12 on the basis of the interprediction parameters outputted thereto from the encoding controllingpart 1 (step ST5). Because a technology of carrying out amotion-compensated prediction process to generate a prediction image isknown, the detailed explanation of this technology will be omittedhereafter.

After the intra prediction part 4 or the motion-compensated predictionpart 5 generates the prediction image (an intra prediction image P_(i)^(n) or an inter prediction image P_(i) ^(n)), the subtracting part 6subtracts the prediction image (the intra prediction image P_(i) ^(n) orthe inter prediction image P_(i) ^(n)) generated by the intra predictionpart 4 or the motion-compensated prediction part 5 from the partitionP_(i) ^(n) of the coding block B^(n), which is generated through thedivision by the block dividing part 2, to generate a difference image,and outputs a prediction error signal e_(i) ^(n) showing the differenceimage to the transformation/quantization part 7 (step ST6).

When receiving the prediction error signal e_(i) ^(n) showing thedifference image from the subtracting part 6, thetransformation/quantization part 7 carries out a transformation process(e.g., a DCT (discrete cosine transform) or an orthogonal transformationprocess, such as a KL transform, in which bases are designed for aspecific learning sequence in advance) on the difference image in unitsof a block having the transform block size included in the predictionerror encoding parameters outputted thereto from the encodingcontrolling part 1, and quantizes the transform coefficients of thedifference image by using the quantization parameter included in theprediction error encoding parameters and outputs the transformcoefficients quantized thereby to the inverse quantization/inversetransformation part 8 and the variable length encoding part 13 ascompressed data of the difference image (step ST7).

When receiving the compressed data of the difference image from thetransformation/quantization part 7, the inverse quantization/inversetransformation part 8 inverse-quantizes the compressed data of thedifference image by using the quantization parameter included in theprediction error encoding parameters outputted thereto from the encodingcontrolling part 1, performs an inverse transformation process (e.g., aninverse DCT (inverse discrete cosine transform) or an inversetransformation process such as an inverse KL transform) on thecompressed data inverse-quantized thereby in units of a block having thetransform block size included in the prediction error encodingparameters, and outputs the compressed data on which the inversequantization/inverse transformation part has carried out the inversetransformation process to the adding part 9 as a local decodedprediction error signal e_(i) ^(n) hat (“̂” attached to an alphabeticalletter is expressed by hat for reasons of the restrictions on electronicapplications) (step ST8).

When receiving the local decoded prediction error signal e_(i) ^(n) hatfrom the inverse quantization/inverse transformation part 8, the addingpart 9 adds the local decoded prediction error signal e_(i) ^(n) hat andthe prediction signal showing the prediction image (the intra predictionimage P_(i) ^(n) or the inter prediction image P_(i) ^(n)) generated bythe intra prediction part 4 or the motion-compensated prediction part 5to generate a local decoded image which is a local decoded partitionimage P_(i) ^(n) hat or a local decoded coding block image which is agroup of local decoded partition images (step ST9). After generating thelocal decoded image, the adding part 9 stores a local decoded imagesignal showing the local decoded image in the memory 10 for intraprediction and also outputs the local decoded image signal to the loopfilter part 11.

The moving image encoding device repeatedly carries out the processes ofsteps ST3 to ST9 until the moving image encoding device completes theprocessing on all the coding blocks B^(n) into which the inputted imageis divided hierarchically, and, when completing the processing on allthe coding blocks B^(n), shifts to a process of step ST12 (steps ST10and ST11).

The variable length encoding part 13 entropy-encodes the compressed dataoutputted thereto from the transformation/quantization part 7, thecoding mode (including the information showing the state of the divisioninto the coding blocks) and the prediction error encoding parameters,which are outputted thereto from the encoding controlling part 1, andthe intra prediction parameters outputted thereto from the intraprediction part 4 or the inter prediction parameters outputted theretofrom the motion-compensated prediction part 5. The variable lengthencoding part 13 multiplexes encoded data which are the encoded resultsof the entropy encoding of the compressed data, the coding mode, theprediction error encoding parameters, and the intra predictionparameters or the inter prediction parameters to generate a bitstream(step ST12).

When receiving the local decoded image signal from the adding part 9,the loop filter part 11 compensates for an encoding distortion includedin the local decoded image signal, and stores the local decoded imageshown by the local decoded image signal on which the loop filter partperforms the encoding distortion compensation in the motion-compensatedprediction frame memory 12 as a reference image (step ST13). The loopfilter part 11 can carry out the filtering process for each coding blockhaving the maximum size of the local decoded image signal outputtedthereto from the adding part 9 or for each coding block of the localdecoded image signal, or for each unit which is a combination of aplurality of coding blocks each having the maximum size. As analternative, after one picture of local decoded image signals isoutputted, the loop filter part can carry out the filtering process onthe picture of local decoded image signals at a time.

Next, the process carried out by the intra prediction unit 4 will beexplained in detail. FIG. 7 is an explanatory drawing showing an exampleof the intra prediction parameters (intra prediction modes) which can beselected for each partition P_(i) ^(n) in the coding block B^(n). In theexample shown in FIG. 7, intra prediction modes and prediction directionvectors represented by each of the intra prediction modes are shown, andit is designed that a relative angle between prediction directionvectors becomes small with increase in the number of selectable intraprediction modes.

The intra prediction part 4 carries out an intra prediction process onthe partition P_(i) ^(n) on the basis of the intra prediction parameterfor the partition P_(i) ^(n) and a selection parameter for a filterwhich the intra prediction part uses for the generation of an intraprediction image P_(i) ^(n). Hereafter, an intra process of generatingan intra prediction signal of the luminance signal on the basis of theintra prediction parameter (intra prediction mode) for the luminancesignal of the partition P_(i) ^(n) will be explained.

Hereafter, the partition P_(i) ^(n) is assumed to have a size of l_(i)^(n)×m_(i) ^(n) pixels. FIG. 8 is an explanatory drawing showing anexample of pixels which are used when generating a predicted value ofeach pixel in the partition P_(i) ^(n) in the case of l_(i) ^(n)=m_(i)^(n)=4. Although the (2×l_(i) ^(n)+1) pixels in the already-encodedupper partition which is adjacent to the partition P_(i) ^(n) and the(2×m_(i) ^(n)) pixels in the already-encoded left partition which isadjacent to the partition P_(i) ^(n) are defined as the pixels used forprediction in the example of FIG. 8, a larger or smaller number ofpixels than the pixels shown in FIG. 8 can be used for prediction.Further, although one row or column of pixels adjacent to the partitionare used for prediction in the example shown in FIG. 8, two or more rowsor columns of pixels adjacent to the partition can be alternatively usedfor prediction.

When the index value indicating the intra prediction mode for thepartition P_(i) ^(n) is 2 (average prediction), the intra predictionpart generates an intermediate prediction image by using the average ofthe adjacent pixels in the upper partition and the adjacent pixels inthe left partition as each of the predicted values of all the pixels inthe partition P_(i) ^(n). When the index value indicating the intraprediction mode is other than 2 (average prediction), the intraprediction part generates the predicted value of each pixel in thepartition P_(i) ^(n) on the basis of a prediction direction vectorv_(p)=(dx, dy) shown by the index value. In this case, the relativecoordinate of the pixel (the pixel at the upper left corner of thepartition is defined as the point of origin) for which the predictedvalue is to be generated (target pixel for prediction) in the partitionP_(i) ^(n) is expressed as (x, y). Each reference pixel which is usedfor prediction is located at a point of intersection of A shown belowand an adjacent pixel.

$A = {\begin{pmatrix}x \\y\end{pmatrix} + {k\; \upsilon_{p}}}$

Where k is a negative scalar value.

When a reference pixel is located at an integer pixel position, theinteger pixel is defined as the predicted value of the target pixel forprediction. In contrast, when a reference pixel is not located at aninteger pixel position, an interpolation pixel which is generated froman integer pixel adjacent to the reference pixel is defined as thepredicted value of the target pixel for prediction. In the example shownin FIG. 8, because a reference pixel is not located at an integer pixelposition, the predicted value is interpolated from the values of twopixels adjacent to the reference pixel. However, the interpolation ofthe predicted value is not limited to the one from the values of twoadjacent pixels, and an interpolation pixel can be generated from two ormore adjacent pixels and the value of this interpolation pixel can bedefined as the predicted value.

The intra prediction part then carries out a filtering process, whichwill be mentioned below, on the intermediate prediction image whichconsists of the predicted values in the partition P_(i) ^(n) generatedaccording to the above-mentioned procedure to acquire a final intraprediction image Pin, and outputs the intra prediction image P_(i) ^(n)to the subtracting part 6 and the adding part 9. The intra predictionpart also outputs the intra prediction parameter used for the generationof the intra prediction image P_(i) ^(n) to the variable length encodingpart 13 in order to multiplex them into a bitstream. Hereafter, thefiltering process will be explained concretely.

The intra prediction part selects a filter to be used from one or morefilters which are prepared in advance by using a method which will bementioned below, and carries out a filtering process on each pixel ofthe intermediate prediction image according to the following equation(1).

ŝ(p ₀)=a ₀ s(p ₀)+a ₁ s(p ₁)+ . . . +a _(N-1) s(p _(N-1))a _(N)  (1)

In the equation (1), an (n=0, 1, . . . , N) is filter coefficients whichconsist of coefficients (a₀, a₁, . . . , a_(N-1)) associated with thereference pixels, and an offset coefficient a_(N). p_(n) (n=0, 1, . . ., N−1) shows the reference pixels of the filter including the targetpixel p₀ to be filtered. N is an arbitrary number of reference pixels.s(p_(n)) shows the luminance value of each reference pixel, and s hat(p₀) shows the luminance value of the target pixel p₀ to be filtered onwhich the filtering process has been carried out. The filtercoefficients can be formed so as not to include the offset coefficienta_(N). Further, the luminance value of each pixel of the intermediateprediction image can be defined as the luminance value s(p_(n)) of eachreference pixel located in the partition P_(i) ^(n). As an alternative,the filtered luminance value can be defined as the luminance values(p_(n)) only at the position of each pixel on which the filteringprocess has been carried out. An encoded luminance value (luminancevalue to be decoded) is set as the luminance value s(p_(n)) of eachreference pixel located outside the partition P_(i) ^(n) when the pixelis in an already-encoded region, while a signal value to be used inplace of the luminance value s(p_(n)) is selected from the luminancevalue s(p_(n)) of each reference pixel located in the partition P, whichis defined in the above-mentioned way, and the encoded luminance valuein the already-encoded area according to a predetermined procedure (forexample, the signal value of a pixel at the nearest position is selectedfrom among those of pixels which are candidates) when the pixel is in ayet-to-be-encoded region. FIG. 9 is an explanatory drawing showing anexample of the arrangement of the reference pixels in the case of N=5.

When carrying out the above-mentioned filtering process, a nonlinearedge or the like occurs in the inputted image more easily and hence adisplacement from the prediction direction of the intermediateprediction image occurs more easily with increase in the size (l_(i)^(n)×m_(i) ^(n)) of the partition P_(i) ^(n). Therefore, it ispreferable to smooth the intermediate prediction image. In addition, thelarger quantized value a prediction error has, the larger quantizationdistortion occurs in the decoded image and hence the lower degree ofprediction accuracy the intermediate prediction image generated fromalready-encoded pixels which are adjacent to the partition P_(i) ^(n)has. Therefore, it is preferable to prepare a smoothed prediction imagewhich roughly expresses the partition P_(i) ^(n). Further, even a pixelin the same partition P_(i) ^(n) has a displacement, such as an edge,occurring between the intermediate prediction image and the inputtedimage more easily with distance from the already-encoded pixels adjacentto the partition P_(i) ^(n) which are used for the generation of theintermediate prediction image. Therefore, it is preferable to smooth theprediction image to suppress the rapid increase in the prediction errorwhich is caused when a displacement occurs.

Further, the intra prediction at the time of generating the intermediateprediction image is configured in such a way as to use either of the twofollowing different methods: an average prediction method of making allthe predicted values in a prediction block be equal to one another, anda prediction method using the prediction direction vector v_(p). Inaddition, also in the case of the prediction using the predictiondirection vector v_(p), a pixel not located at an integer pixel positionis generated through interpolation on both a pixel for which the valueof a reference pixel at an integer pixel position is set as itspredicted value just as it is, and at least two reference pixels, thelocation in the prediction block of a pixel having the value of thegenerated pixel as its predicted value differs according to thedirection of the prediction direction vector v_(p). Therefore, becausethe prediction image has a property different according to the intraprediction mode, and the optimal filtering process also changesaccording to the intra prediction mode, it is preferable to also changethe intensity of the filter, the number of reference pixels to bereferred to by the filter, the arrangement of the reference pixels, etc.according to the index value showing the intra prediction mode.

Therefore, the filter selecting process is configured in such a way asto select a filter in consideration of the four following parameters (1)to (4).

(1) The size of the partition P_(i) ^(n) (l_(i) ^(n)×m_(i) ^(n))(2) The quantization parameter included in the prediction error encodingparameters(3) The distance between the group of already-encoded pixels (“pixelswhich are used for prediction” shown in FIG. 8) which are used at thetime of generating the intermediate prediction image, and the targetpixel to be filtered(4) The index value indicating the intra prediction mode at the time ofgenerating the intermediate prediction image.

More specifically, the filter selecting process is configured in such away as to use a filter having a higher degree of smoothing intensity ora filter having a larger number of reference pixels with increase in thesize (l_(i) ^(n)×m_(i) ^(n)) of the partition P_(i) ^(n), with increasein the quantized value determined by the quantization parameter, andwith distance between the target pixel to be filtered and the group ofalready-encoded pixels which are located on the left side and on theupper side of the partition P_(i) ^(n). An example of the distancebetween the target pixel to be filtered and the group of already-encodedpixels which are located on the left side and on the upper side of thepartition P_(i) ^(n) is listed in FIG. 11. Further, the filter selectingprocess is configured in such a way as to also change the intensity ofthe filter, the number of reference pixels to be referred to by thefilter, the arrangement of the reference pixels, etc. according to theindex value showing the intra prediction mode. More specifically, anadaptive selection of a filter according to the above-mentionedparameters is implemented by bringing an appropriate filter selectedfrom among the group of filters which are prepared in advance intocorrespondence with each of combinations of the above-mentionedparameters. Further, for example, when combining the parameters (3) and(4), the definition of the “distance between the target pixel to befiltered and the group of already-encoded pixels” of the parameter (3)can be changed adaptively according to the “intra prediction mode” ofthe parameter (4). More specifically, the definition of the distancebetween the target pixel to be filtered and the group of already-encodedpixels is not limited to the one fixed as shown in FIG. 11, and can be adistance depending upon the prediction direction, such as the distancefrom a “reference pixel” shown in FIG. 8. By doing in this way, theintra prediction part can implement an adaptive filtering process whichalso takes into consideration a relationship between the plurality ofparameters such as the parameters (3) and (4). Further, a combinationfor not carrying out any filtering process can be prepared as one ofcombinations of these parameters while being brought into correspondencewith “no filtering process.” In addition, as a definition of theintensity of the filter, the weakest filter can be defined as “nofiltering process.” Further, because the four parameters (1) to (4) areknown in the moving image decoding device, no additional information tobe encoded required to carry out the above-mentioned filtering processis generated. As previously explained, by preparing a necessary numberof filters in advance and adaptively selecting one of them, the intraprediction part switches among the filters. As an alternative, bydefining a function of the above-mentioned filter selection parametersas each filter in such a way that a filter is computed according to thevalues of the above-mentioned filter selection parameters, the intraprediction part can implement switching among the filters.

Although the example of selecting a filter in consideration of the fourparameters (1) to (4) is shown in the above explanation, a filter can bealternatively selected in consideration of at least one of the fourparameters (1) to (4). Hereafter, an example of the configuration of thefiltering process of adaptively selecting a filter by bringing anappropriate filter included in a filter group prepared in advance intocorrespondence with each of combinations of the parameters will be shownby taking a case of using the parameters (1) and (4) as an example.

Filters which are used in the above-mentioned example of the filteringprocess are defined as follows:

Filter of filter index of 1 (the number of reference pixels N=3):

a₀=¾, a₁=⅛, a₂=⅛

Filter of filter index of 2 (the number of reference pixels N=3):

a₀=½, a₁=¼, a₂=¼

Filter of filter index of 3 (the number of reference pixels N=3)

a₀=¼, a₁=⅜, a₂=⅜

Filter of filter index of 4 (the number of reference pixels N=5)

a₀=¼, a₁= 3/16, a₂= 3/16, a₃= 3/16, a₄= 3/16

In this case, it is assumed that the filtering process is based on theequation (1) from which the offset coefficient a_(N) is eliminated(a_(N)=0), three types of filters are used, and each of these filtershas such an arrangement of reference pixels to be referred to thereby asshown in FIG. 12.

FIG. 13 is an explanatory drawing showing an example of a table showingfilters which are used in each intra prediction mode for each size ofthe partition P_(i) ^(n). In this example, it is assumed that thepartition P_(i) ^(n) has one of possible sizes of 4×4 pixels, 8×8pixels, 16×16 pixels, 32×32 pixels, and 64×64 pixels, and there is acorrespondence, as shown in FIG. 7, between index values each showing anintra prediction mode and intra prediction directions. Further, thefilter index of 0 shows that no filtering process is carried out. Ingeneral, because there are tendencies as will be shown below when usinga directional prediction or an average prediction, by bringing whichfilter is to be used into correspondence with each combination of theparameters (1) and (4) in the table in consideration of thecharacteristics of the image in intra predictions, as shown in the tableshown in FIG. 13, the intra prediction part can implement the selectionof an appropriate filter by referring to the table.

Because a horizontal or vertical edge existing in an artifact, such as abuilding, is generally linear shaped and clear in many cases, ahigh-accurate prediction can be carried out by using a horizontal orvertical prediction in many cases. Therefore, it is preferable not tocarry out any smoothing process when carrying out a horizontal orvertical prediction.

Because an image signal generally has high spatial continuity, it ispreferable to carry out a smoothing process on pixels located in thevicinity of the block boundaries on the left and upper sides of thepartition P_(i) ^(n), thereby improving the continuity, when using anaverage prediction which impairs the continuity between the partitionP_(i) ^(n) and already-encoded pixels adjacent to the partition P_(i)^(n).

Because in a region having diagonal directivity, an edge or the like isdistorted and has a nonlinear shape in many cases with increase in thearea of the region, it is preferable to, when using a diagonalprediction, apply a filter having a higher degree of smoothing intensityand a larger number of reference pixels with increase in the partitionsize.

In general, when the partition size becomes too large, a spatial changeof the signal value in the partition becomes diversified, so that theuse of a directional prediction or an average prediction results in avery rough prediction, and hence a region where it is difficult to carryout a high-accurate prediction increases. Because no improvement in theprediction efficiency can be expected by simply carrying out a smoothingprocess to make the image become blurred in such a region, it ispreferable not to carry out any filtering process in the case of such alarge partition size because it is not necessary to increase thecomputational complexity unnecessarily (for example, in the table shownin FIG. 13, there is a setting not to carry out any filtering process inthe case of a partition size of 32×32 pixels or more).

In addition, in a case in which the luminance value of the intermediateprediction image is used as the luminance value of each reference pixelwhen each reference pixel at the time that a filtering process iscarried out is a pixel in the partition P_(i) ^(n), there is a case inwhich the filtering process can be simplified. For example, when theintra prediction mode is an average prediction, the filtering process onthe partition P_(i) ^(n) can be simplified to the following filteringprocess for each region shown in FIG. 14.

Region A (pixel at the upper left corner of the partition P_(i) ^(n))

Filter of filter index of 1 (no change):

a₀=¾, a₁=⅛, a₂=⅛ (the number of reference pixels N=3)

Filter of filter index of 2 (no change):

a₀=½, a₁=¼, a₂=¼ (the number of reference pixels N=3)

Filter of filter index of 3 (no change):

a₀=¼, a₁=⅜, a₂=⅜ (the number of reference pixels N=3)

Filter of filter index of 4:

a₀=⅝, a₁= 3/16, a₂= 3/16 ((the number of reference pixels N=3)

Region B (pixels at the upper end of the partition P_(i) ^(n) other thanthe region A)

Filter of filter index of 1:

a₀=⅞, a₂=⅛ (the number of reference pixels N=2)

Filter of filter index of 2:

a₀=¾, a₂=¼ (the number of reference pixels N=2)

Filter of filter index of 3:

a₀=⅝, a₂=⅜ (the number of reference pixels N=2)

Filter of filter index of 4:

a₀= 13/16, a₂= 3/16 (the number of reference pixels N=2)

Region C (pixels at the left end of the partition P_(i) ^(n) other thanthe region A)

Filter of filter index of 1:

a₀=⅞, a₁=⅛ (the number of reference pixels N=2)

Filter of filter index of 2:

a₀=¾, a₁=¼ (the number of reference pixels N=2)

Filter of filter index of 3:

a₀=⅝, a₁=⅜ (the number of reference pixels N=2)

Filter of filter index of 4:

a₀= 13/16, a₁= 3/16 (the number of reference pixels N=2)

Region D (pixels in the partition P_(i) ^(n) other than the regions A,B, and C)

Filters of all filter indexes: no filtering process

Even if the filtering process is simplified in the above-mentioned way,the results of the filtering process are the same as those of thefiltering process yet to be simplified. By removing the redundant partsof the actual process in this way, the filtering process can be speededup.

Although the table shown in FIG. 13 is used in the above-mentionedexample, another table can be alternatively used. For example, whengreater importance is placed on a reduction in the computationalcomplexity caused by the filtering process than on the degree ofimprovement in the encoding performance, a table shown in FIG. 19 can beused instead of the table shown in FIG. 13. Because the intra predictionunit carries out the filtering process only on the average prediction ofthe partition P_(i) ^(n) whose size is 4×4 pixels, 8×8 pixels, or 16×16pixels in the case of using this table, the number of prediction modesin each of which the filtering process is carried out is less than thatin the case of using the table shown in FIG. 13, and therefore theincrease in the computational complexity caused by the filtering processcan be reduced. At this time, by using a simplification of the filteringprocess in the case in which the above-mentioned intra prediction modeis an average prediction, the filtering process can be implemented withvery low computational complexity. In addition, when importance isplaced on the ease of implementation, the intra prediction unit cancarry out the filtering process only on the average prediction, like inthe case of carrying out the above-mentioned filtering process, and canuse the same filter (e.g., the filter of filter index of 2) at all timeswithout not having to change the filter to be used according to the sizeof the partition P_(i) ^(n). In that case, while the degree ofimprovement in the encoding performance using the filter is reduced by adegree corresponding to the elimination of the process according to thesize of the partition P_(i) ^(n), the circuit scale of the intraprediction unit installed in the device (the number of lines in the codein the case of implementing the intra prediction unit via software) canbe reduced. This filtering process is simplified to a filter which takesinto consideration only the parameter (4) among the four parameters (1)to (4).

The filtering process does not have to be implemented in a form in whicha filter having a corresponding filter index is selected throughreference to the table, and can be alternatively implemented in a formin which the filter is installed directly in the intra prediction part.For example, the filtering process is implemented in a form in which afiltering process to be carried out for each of the possible sizes ofthe partition P_(i) ^(n) is incorporated directly into the intraprediction part, or a filtering process to be carried out for each pixelposition in each of the possible sizes of the partition P_(i) ^(n) isincorporated directly into the intra prediction part. As long as theprediction image which is acquired as the result of carrying out thefiltering process without referring to the table in this way isequivalent to that acquired as the result of carrying out the filteringprocess by referring to the table, the form of the implementation is notan issue.

Further, although the method of using only one table for switching amongthe filters is explained in the example mentioned above, two or moretables as mentioned above can be prepared, and the moving image encodingdevice can be constructed in such a way as to encode a filter selectiontable index 100 as header information in such a form as shown in eitherof FIGS. 15 to 18, and switch among the filter selection tables for eachpredetermined unit. For example, by adding the filter selection tableindex 100 to a sequence level header, as shown in FIG. 15, the movingimage encoding device can carry out a filtering process more suitablefor the characteristics of the sequence as compared with the case ofusing only a single table.

Even in a case in which the intra prediction part 4 is constructed insuch a way as to set already-encoded pixels adjacent to the partitionP_(i) ^(n) on which the intra prediction part has carried out thesmoothing process as the reference pixels at the time of generating anintermediate prediction image of the partition P_(i) ^(n), like in acase in which a smoothing process is carried out on a reference image atthe time of an intra prediction on an 8×8-pixel block in MPEG-4AVC/H.264 explained previously, the intra prediction part 4 can carryout the filtering process on an intermediate prediction image similar tothat shown in the above-mentioned example. On the other hand, becausethere is an overlap between the effect of the smoothing process on thereference pixels at the time of generating an intermediate predictionimage and that of the filtering process on the intermediate predictionimage, there is a case in which even if both the processes are usedsimultaneously, only a very small performance improvement is produced ascompared with a case in which one of the processes is carried out.Therefore, in a case in which importance is placed on reduction in thecomputational complexity, the intra prediction part can be constructedin such a way as not to carry out the filtering process on theintermediate prediction image of the partition P_(i) ^(n) for which theintra prediction part has carried out the smoothing process on thereference pixels at the time of generating the intermediate predictionimage. For example, there can be a case in which when carrying out thefiltering process on the intermediate prediction image, the intraprediction part carries out the filtering process only on an averageprediction, as shown in the table of FIG. 19, while when carrying outthe smoothing process on the reference pixels at the time of generatingthe intermediate prediction image, the intra prediction part carries outthe smoothing process by referring to the table, as shown in FIG. 20,showing that only specific directional predictions are subjected to thesmoothing process. In FIG. 20, ‘1’ shows that the smoothing process iscarried out and ‘0’ shows that the smoothing process is not carried out.

The intra prediction part outputs the intra prediction parameter usedfor the generation of the intra prediction image Pi to the variablelength encoding part 13 in order to multiplex them into a bitstream. Theintra prediction part also carries out an intra prediction process basedon the intra prediction parameter (intra prediction mode) on each of thecolor difference signals of the partition P_(i) ^(n) according to thesame procedure as that according to which the intra prediction partcarries out the intra prediction process on the luminance signal, andoutputs the intra prediction parameters used for the generation of theintra prediction image to the variable length encoding part 13. Theintra prediction part can be constructed in such a way as to carry outthe above-explained filtering process for the intra prediction of eachof the color difference signals in the same way that the intraprediction part does for the luminance signal, or not to carry out theabove-explained filtering process for the intra prediction of each ofthe color difference signals.

Next, the processing carried out by the moving image decoding deviceshown in FIG. 2 will be explained. When receiving the bitstreamoutputted thereto from the image encoding device of FIG. 1, the variablelength decoding part 51 carries out a variable length decoding processon the bitstream to decode information having a frame size in units of asequence which consists of one or more frames of pictures or in units ofa picture (step ST21 of FIG. 4). The variable length decoding part 51determines a maximum size of each of coding blocks which is a unit to beprocessed at a time when an intra prediction process (intra-frameprediction process) or a motion-compensated prediction process(inter-frame prediction process) is carried out according to the sameprocedure as that which the encoding controlling part 1 shown in FIG. 1uses, and also determines an upper limit on the number of hierarchicallayers in a hierarchy in which each of the coding blocks having themaximum size is hierarchically divided into blocks (step ST22). Forexample, when the maximum size of each of coding blocks is determinedaccording to the resolution of the inputted image in the image encodingdevice, the variable length decoding part determines the maximum size ofeach of the coding blocks on the basis of the frame size informationwhich the variable length decoding part has decoded previously. Wheninformation showing both the maximum size of each of the coding blocksand the upper limit on the number of hierarchical layers is multiplexedinto the bitstream, the variable length decoding part refers to theinformation which is acquired by decoding the bitstream.

Because the information showing the state of the division of each of thecoding blocks B⁰ having the maximum size is included in the coding modem(B⁰) of the coding block B⁰ having the maximum size which ismultiplexed into the bitstream, the variable length decoding part 51specifies each of the coding blocks B^(n) into which the image isdivided hierarchically by decoding the bitstream to acquire the codingmode m(B⁰) of the coding block B⁰ having the maximum size which ismultiplexed into the bitstream (step ST23). After specifying each of thecoding blocks B^(n), the variable length decoding part 51 decodes thebitstream to acquire the coding mode m(B^(n)) of the coding block B^(n)to specify each partition P_(i) ^(n) belonging to the coding block B^(n)on the basis of the information about the partition P_(i) ^(n) belongingto the coding mode m(B^(n)). After specifying each partition P_(i) ^(n)belonging to the coding block B, the variable length decoding part 51decodes the encoded data to acquire the compressed data, the codingmode, the prediction error encoding parameters, and the intra predictionparameter/inter prediction parameter for each partition P_(i) ^(n) (stepST24).

More specifically, when the coding mode m(B^(n)) assigned to the codingblock B^(n) is an intra coding mode, the variable length decoding partdecodes the encoded data to acquire the intra prediction parameter foreach partition P_(i) ^(n) belonging to the coding block. In contrast,when the coding mode m(B^(n)) assigned to the coding block B^(n) is aninter coding mode, the variable length decoding part decodes the encodeddata to acquire the inter prediction parameters for each partition P_(i)^(n) belonging to the coding block. The variable length decoding partfurther divides each partition which is a prediction unit into one ormore partitions which is a transformation process unit on the basis ofthe transform block size information included in the prediction errorencoding parameters, and decodes the encoded data of each of the one ormore partitions which is a transformation process unit to acquire thecompressed data (transform coefficients on which transformation andquantization are carried out) of the partition.

When the coding mode m(B^(n)) of the partition P_(i) ^(n) belonging tothe coding block B^(n), which is specified by the variable lengthdecoding part 51, is an intra coding mode (step ST25), the selectionswitch 52 outputs the intra prediction parameters outputted thereto fromthe variable length decoding part 51 to the intra prediction part 53. Incontrast, when the coding mode m(B) of the partition P_(i) ^(n) is aninter coding mode (step ST25), the selection switch outputs the interprediction parameters outputted thereto from the variable lengthdecoding part 51 to the motion-compensated prediction part 54.

When receiving the intra prediction parameter from the selection switch52, the intra prediction part 53 carries out an intra-frame predictionprocess on the partition P_(i) ^(n) of the coding block B^(n) togenerate an intra prediction image P_(i) ^(n) by using analready-decoded image signal in the frame on the basis of the intraprediction parameter (step ST26), like the intra prediction part 4 shownin FIG. 1. After generating the above-mentioned intra prediction imageP_(i) ^(n), the intra prediction part 53 selects a filter from one ormore filters, which are prepared in advance, according to the states ofthe various parameters which are known at the time of generating theabove-mentioned intra prediction image P_(i) ^(n) by using the samemethod as that which the intra prediction part 4 shown in FIG. 1 uses,and carries out a filtering process on the intra prediction image P_(i)^(n) by using the filter and sets the intra prediction image P_(i) ^(n)on which the intra prediction part has carried out the filtering processas a final intra prediction image. More specifically, the intraprediction part selects a filter by using the same parameters as thosewhich the intra prediction part 4 uses for the filter selection and byusing the same method as the filter selection method which the intraprediction part 4 uses, and carries out the filtering process on theintra prediction image. For example, in a case in which the intraprediction part 4 brings the case of not carrying out the filteringprocess into correspondence with the filter index of 0, and furtherbrings four filters which are prepared in advance into correspondencewith filter indexes of 1 to 4 respectively, and carries out thefiltering process by referring to the table shown in FIG. 13, the intraprediction part 53 is constructed in such a way as to also define thesame filters and filter indexes as those for use in the intra predictionpart 4, and carry out a filter selection according to the size of thepartition P_(i) ^(n) and the index showing an intra prediction modewhich is an intra prediction parameter by referring to the table shownin FIG. 13 and carry out the filtering process.

Further, in a case in which a table for defining a filter which is usedfor each combination of parameters is prepared, and the intra predictionpart implements switching among filters by referring to the table, asshown in the above-mentioned example, the intra prediction part isconstructed in such a way as to decode the filter selection table index100 as header information in a form as shown in either of FIGS. 15 to18, select the table shown by the decoded filter selection table index100 from the same table group as that which the moving image encodingdevice uses, the table group being prepared in advance, and select afilter by referring to the table.

When receiving the inter prediction parameters from the selection switch52, the motion-compensated prediction part 54 carries out anmotion-compensated prediction process on the partition P_(i) ^(n) of thecoding block B^(n) to generate an inter prediction image P_(i) ^(n) byusing one or more frames of reference images stored in themotion-compensated prediction frame memory 59 on the basis of the interprediction parameters (step ST27).

The inverse quantization/inverse transformation part 55inverse-quantizes the compressed data associated with the coding block,which are outputted thereto from the variable length decoding part 51,by using the quantization parameter included in the prediction errorencoding parameters outputted thereto from the variable length decodingpart 51, and carries out an inverse transformation process (e.g., aninverse DCT (inverse discrete cosine transform) or an inversetransformation process such as an inverse KL transform) on thecompressed data inverse-quantized thereby in units of a block having thetransform block size included in the prediction error encodingparameters, and outputs the compressed data on which the inversequantization/inverse transformation part has carried out the inversetransformation process to the adding part 56 as a decoded predictionerror signal (signal showing a pre-compressed difference image) (stepST28).

When receiving the decoded prediction error signal from the inversequantization/inverse transformation part 55, the adding part 56generates a decoded image by adding the decoded prediction error signaland the prediction signal showing the prediction image generated by theintra prediction part 53 or the motion-compensated prediction part 54and stores a decoded image signal showing the decoded image in thememory 57 for intra prediction, and also outputs the decoded imagesignal to the loop filter part 58 (step ST29).

The moving image decoding device repeatedly carries out the processes ofsteps ST23 to ST29 until the moving image decoding device completes theprocessing on all the coding blocks B^(n) into which the image isdivided hierarchically (step ST30). When receiving the decoded imagesignal from the adding part 56, the loop filter part 58 compensates foran encoding distortion included in the decoded image signal, and storesthe decoded image shown by the decoded image signal on which the loopfilter part performs the encoding distortion compensation in themotion-compensated prediction frame memory 59 as a reference image (stepST31). The loop filter part 58 can carry out the filtering process foreach coding block having the maximum size of the local decoded imagesignal outputted thereto from the adding part 56 or each coding block.As an alternative, after the local decoded image signal corresponding toall the macroblocks of one screen is outputted, the loop filter part cancarry out the filtering process on all the macroblocks of the one screenat a time.

As can be seen from the above description, because the intra predictionpart 4 of the moving image encoding device in accordance with thisEmbodiment 1 is constructed in such a way as to, when carrying out anintra-frame prediction process to generate an intra prediction image byusing an already-encoded image signal in a frame, select a filter fromone or more filters which are prepared in advance according to thestates of various parameters associated with the encoding of a targetblock to be filtered, and carry out a filtering process on a predictionimage by using the filter, there is provided an advantage of being ableto reduce prediction errors which occur locally, thereby being able toimprove the image quality.

Further, because the intra prediction part 4 in accordance with thisEmbodiment 1 is constructed in such a way as to select a filter inconsideration of at least one of the following parameters: (1) the sizeof the partition P_(i) ^(n) (l_(i) ^(n)×m_(i) ^(n)); (2) thequantization parameter included in the prediction error encodingparameters; (3) the distance between the group of already-encoded pixelswhich are used at the time of generating the intermediate predictionimage, and the target pixel to be filtered; and (4) the index valueindicating the intra prediction mode at the time of generating theintermediate prediction image, there is provided an advantage ofpreventing a local prediction error from occurring when, for example, anedge of the image to be encoded becomes distorted slightly in anonlinear shape or a slight displacement occurs in the angle of an edgein the image to be encoded when carrying out a directional prediction,and preventing a prediction error from occurring at a boundary betweenblocks due to a loss of the continuity with the signal of analready-encoded pixel adjacent to the partition when carrying out anaverage prediction, thereby being able to improve the predictionefficiency.

Because the intra prediction part 53 of the moving image decoding devicein accordance with this Embodiment 1 is constructed in such a way as to,when carrying out an intra-frame prediction process to generate an intraprediction image by using an already-decoded image signal in a frame,select a filter from one or more filters which are prepared in advanceaccording to the states of various parameters associated with thedecoding of a target block to be filtered, and carry out a filteringprocess on a prediction image by using the filter, there is provided anadvantage of reducing prediction errors which occur locally while makingit possible for the moving image decoding device to also generate thesame intra prediction image as that generated by the moving imageencoding device.

Further, because the intra prediction part 53 in accordance with thisEmbodiment 1 is constructed in such a way as to select a filter inconsideration of at least one of the following parameters: (1) the sizeof the partition P_(i) ^(n) (l_(i) ^(n)×m_(i) ^(n)); (2) thequantization parameter included in the prediction error encodingparameters; (3) the distance between the group of already-encoded pixelswhich are used at the time of generating the intermediate predictionimage, and the target pixel to be filtered; and (4) the index valueindicating the intra prediction mode at the time of generating theintermediate prediction image, there are provided an advantage ofpreventing a local prediction error from occurring when, for example, anedge of the image to be encoded becomes distorted slightly in anonlinear shape or a slight displacement occurs in the angle of an edgein the image to be encoded when carrying out a directional prediction,and preventing a prediction error from occurring at a boundary betweenblocks due to a loss of the continuity with the signal of analready-encoded pixel adjacent to the partition when carrying out anaverage prediction, and another advantage of making it possible for themoving image decoding device to also generate the same intra predictionimage as that generated by the moving image encoding device.

Embodiment 2

Although the example in which the intra prediction part 4 selects afilter according to the states of various parameters associated with theencoding of a target block to be filtered from one or more filters whichare prepared in advance, and carries out a filtering process on aprediction image by using the filter when carrying out an intra-frameprediction process to generate an intra prediction image by using analready-encoded image signal in a frame is shown in above-mentionedEmbodiment 1, as an alternative, a Wiener filter which minimizes the sumof squared errors between a coding block and a prediction image can bedesigned, and, when the use of this Wiener filter increases the degreeof reduction in prediction errors as compared with the use of the filterwhich has been selected from the one or more filters which are preparedin advance, the filtering process can be carried out on the predictionimage by using the above-mentioned Wiener filter, instead of the filterwhich has been selected. Hereafter, processes will be explainedconcretely.

Each of the intra prediction parts 4 and 53 in accordance withabove-mentioned Embodiment 1 is constructed in such a way as to select afilter from one or more filters which are prepared in advance accordingto the states of various parameters associated with the encoding of atarget block to be filtered. While each of the intra prediction partscan select an appropriate filter from the one or more selectioncandidates in consideration of the four parameters (1) to (4), each ofthe intra prediction parts cannot carry out “optimal filtering” when anoptimal filter other than the one or more selection candidates exists.This Embodiment 2 is characterized in that while a moving image encodingdevice designs an optimal filter on a per picture basis and carries outa filtering process, and also encodes the filter coefficients of thefilter, and so on, a moving image decoding device decodes the filtercoefficients and so on, and carries out a filtering process by using thefilter.

An intra prediction part 4 of the moving image encoding device carriesout an intra-frame prediction process on each partition P_(i) ^(n) ofeach coding block B^(n) to generate an intra prediction image Pin, likethat according to above-mentioned Embodiment 1. The intra predictionpart 4 also selects a filter from one or more filters which are preparedin advance according to the states of various parameters associated withthe encoding of a target block to be filtered by using the same methodas that the intra prediction part according to above-mentionedEmbodiment 1 uses, and carries out a filtering process on the intraprediction image P_(i) ^(n) by using this filter. After determiningintra prediction parameters for each of all coding blocks B^(n) in thepicture, for each area in which an identical filter is used within thepicture (each area having the same filter index), the intra predictionpart 4 designs a Wiener filter which minimizes the sum of squared errorsbetween the inputted image in the area and the intra prediction image(mean squared error in the target area).

The filter coefficients w of the Wiener filter can be determined from anautocorrelation matrix R_(s′s′) of an intermediate prediction imagesignal s′, and a cross correlation matrix R_(ss′) of the inputted imagesignal s and the intermediate prediction image signal s′ according tothe following equation (4). The size of the matrices R_(s′s′) andR_(ss′) corresponds to the number of filter taps determined.

w=R _(s′s′) ⁻¹ ·R _(ss′)  (4)

After designing the Wiener filter, the intra prediction part 4 expressesthe sum of squared errors in the target area for filter design in thecase of carrying out a filtering process using the Wiener filter as D1,the code amount at the time of encoding information (e.g., filtercoefficients) associated with the Wiener filter as R1, and the sum ofsquared errors in the target area for filter design in the case ofcarrying out a filtering process using a filter which is selected byusing the same method as that shown in above-mentioned Embodiment 1 asD2, and then checks to see whether or not the following equation (5) isestablished.

D1+λ·R1<D2  (5)

Where λ is a constant.

When the equation (5) is established, the intra prediction part 4carries out a filtering process by using the Wiener filter instead of afilter which is selected by using the same method as that shown inabove-mentioned Embodiment 1. In contrast, when the equation (5) is notestablished, the intra prediction part carries out a filtering processby using a filter which the intra prediction part selects by using thesame method as that shown in above-mentioned Embodiment 1. Although theintra prediction part carries out the evaluation by using the sums ofsquared errors D1 and D2, this embodiment is not limited to thisexample. The intra prediction part can alternatively carry out theevaluation by using measures showing other prediction distortion values,such as the sums of the absolute values of errors, instead of the sumsof squared errors D1 and D2.

When carrying out a filtering process by using the Wiener filter, theintra prediction part 4 requires filter update information showing thefilter coefficients of the Wiener filter and indexes each indicating acorresponding filter which is replaced by the Wiener filter. Morespecifically, when the number of filters selectable in the filteringprocess using filter selection parameters is expressed as L, and indexesranging from zero to L−1 are assigned to the filters, respectively, whenthe designed Wiener filter is used for each index, a value of “1” needsto be encoded for the index as the filter update information, whereaswhen a prepared filter is used for each index, a value of “0” needs tobe encoded for the index as the filter update information. A variablelength encoding part 13 variable-length-encodes the filter updateinformation outputted thereto from the intra prediction part 4, andmultiplexes encoded data of the filter update information into abitstream.

Although the example of designing a Wiener filter which minimizes themean squared error between the inputted image and a prediction image ineach area for which an identical filter is used within a picture for thearea is shown in this embodiment, a Wiener filter which minimizes themean squared error between the inputted image and a prediction image ineach area for which an identical filter is used can be designed for eachof other specific areas each of which is not a picture. For example, theabove-mentioned design of a Wiener filter can be carried out only for acertain specific picture or only when a specific condition is satisfied(e.g., only for a picture to which a scene change detection function isadded and in which a scene change is detected).

A variable length decoding part 51 of a moving image decoding devicevariable-length-decodes the encoded data multiplexed into the bitstreamto acquire the filter update information. An intra prediction part 53carries out an intra-frame prediction process on each partition P_(i)^(n) of each coding block B^(n) to generate a intra prediction imageP_(i) ^(n), like that according to above-mentioned Embodiment 1. Whenreceiving the filter update information from the variable lengthdecoding part 51, the intra prediction part 53 refers to the filterupdate information to check to see whether or not there is an update tothe filter indicated by the corresponding index.

When determining from the result of the check that the filter for acertain area is replaced by a Wiener filter, the intra prediction part53 reads the filter coefficients of the Wiener filter which are includedin the filter update information to specify the Wiener filter, andcarries out a filtering process on the intra prediction image P_(i) ^(n)by using the Wiener filter. In contrast, for an area in which no filteris replaced by a Wiener filter, the intra prediction part selects afilter by using the same method as that which the intra prediction partaccording to above-mentioned Embodiment 1 uses, and carries out afiltering process on the intra prediction image P_(i) ^(n) by using thefilter.

As can be seen from the above description, because the moving imageencoding device in accordance with this Embodiment 2 is constructed insuch a way as to design a Wiener filter which minimizes the sum ofsquared errors between a coding block and a prediction image, and, whenthe use of this Wiener filter increases the degree of reduction inprediction errors as compared with the use of a filter which is selectedfrom one or more filters which are prepared in advance, carry out afiltering process on the prediction image by using the Wiener filter,instead of the selected filter, there is provided an advantage of beingable to further reduce prediction errors which occur locally as comparedwith above-mentioned Embodiment 1.

While the invention has been described in its preferred embodiments, itis to be understood that an arbitrary combination of two or more of theabove-mentioned embodiments can be made, various changes can be made inan arbitrary component according to any one of the above-mentionedembodiments, and an arbitrary component according to any one of theabove-mentioned embodiments can be omitted within the scope of theinvention.

INDUSTRIAL APPLICABILITY

The present invention is suitable for an image encoding device thatneeds to encode an image with a high degree of efficiency, and is alsosuitable for an image decoding device that needs to decode an imageencoded with a high degree of efficiency.

EXPLANATIONS OF REFERENCE NUMERALS

1 encoding controlling part (encoding controlling unit), 2 blockdividing part (block dividing unit), 3 selection switch (intraprediction unit and motion-compensated prediction unit), 4 intraprediction part (intra prediction unit), 5 motion-compensated predictionpart (motion-compensated prediction unit), 6 subtracting part(difference image generating unit), 7 transformation/quantization part(image compression unit), 8 inverse quantization/inverse transformationpart, 9 adding part, 10 memory for intra prediction, 11 loop filteringpart, 12 motion-compensated prediction frame memory, 13 variable lengthencoding part (variable length encoding unit), 31 variable lengthdecoding part (variable length decoding unit), 52 selection switch(intra prediction unit and motion-compensated prediction unit), 53 intraprediction part (intra prediction unit), 54 motion-compensatedprediction part (motion-compensated prediction unit), 55 inversequantization/inverse transformation part (difference image generatingunit), 56 adding part (decoded image generating unit), 57 memory forintra prediction, 58 loop filtering part, 12 motion-compensatedprediction frame memory, 100 filter selection table index.

1. An image encoding device comprising: an intra predictor for, when a coding mode corresponding to one of coding blocks into which an inputted image is divided is an intra coding mode, carrying out an intra-frame prediction process on each block which is a unit for prediction of the coding block to generate a prediction image; and an encoder for encoding coding mode information and an intra prediction parameter indicating an average prediction, wherein when the intra predictor carries out the average prediction, the intra predictor carries out a filtering process on target pixels of the intra prediction, wherein the target pixels consist of pixels located at a specific position of the bock, the filtering process using an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the block, and the intra predictor does not carry out the filtering process on pixels located at the other position of the block.
 2. An image decoding device comprising: a decoder for decoding coding mode information and an intra prediction parameter; and an intra predictor for, when the coding mode information associated with a coding block is an intra coding mode, carrying out an intra-frame prediction process on each block which is a unit for prediction of the coding block to generate a prediction image, wherein when the intra prediction parameter indicates an average prediction, the intra predictor carries out a filtering process on target pixels of the intra prediction, wherein the target pixels consist of pixels located at a specific position of the block based on an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the block, and the intra predictor does not carry out the filtering process on pixels located at the other position of the block.
 3. An image encoding method comprising: carrying out an intra-frame prediction process on each block which is a unit for prediction of a coding block to generate a prediction image, when a coding mode corresponding to the one of coding blocks into which an inputted image is divided is an intra coding mode; and encoding coding mode information and an intra prediction parameter indicating an average prediction, wherein when the average prediction is carried out, a filtering process is carried out on target pixels of the intra prediction, wherein the target pixels consist of pixels located at a specific position of the block which is a unit for prediction of the coding block, the filtering process using an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the block, and the filtering process is not carried out the on pixels located at the other position of the block.
 4. An image decoding method comprising: decoding coding mode information and an intra prediction parameter; and carrying out an intra-frame prediction process on each block which is a unit for prediction of a coding block to generate a prediction image, when the coding mode information associated with the coding block is an intra coding mode, wherein when the intra prediction parameter shows an average prediction, a filtering process is carried out on target pixels of the intra prediction, wherein the target pixels consist of pixels located at a specific position of the block which is a unit for prediction of the coding block, the filtering process using an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the block, and the filtering process is not carried out the on pixels located at the other position of the block.
 5. A non-transitory computer readable medium comprising coded data for each of coding blocks, the coded data including: coding mode information causing a decoder to determine a type of coding mode, and causing the decoder to carry out an intra-frame prediction process on each block which is a unit for prediction of a coding block to generate a prediction image, when the coding mode information associated with the coding block indicates an intra coding mode; and an intra prediction parameter causing the decoder to determine a type of intra prediction, wherein when the intra prediction parameter indicates an average prediction, a filtering process is carried out on target pixels of the intra prediction located at a specific position of the block which is a unit for prediction of the coding block, the filtering process using an intermediate prediction value, which is an average value of adjacent pixels of the block, and at least one adjacent pixel of the block, and the filtering process is not carried out the on pixels located at the other position of the block. 